// 引入api
import {reqCategory} from '@/api';
const state={
    category:[]
};
const mutations={
    CATEGORYLIST:(state,payload) =>{
        state.category=payload;
    }
};

const actions={
    // 书写categoryList类型action
    categoryList:async({state,dispatch,commit})=>{
       let result=await reqCategory();
       if (result.code==200) {
           commit('CATEGORYLIST',result.data)
       }
    }

};



const getters={};

export default{
    state,
    mutations,
    actions,
    getters,
}